﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="AnyOffice.general.meeting.query.index" %>

<%@ Reference Page="~/general/index.aspx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title></title>
		
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link href="/module/date_selector/popcalendar.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" language="javascript" src="/module/date_selector/popcalendar.js"></script>
		<script type="text/javascript" language="javascript" src="/aspnet_client/core/function.js"></script>
		<script  type="text/javascript" language="javascript">	
		function open_meeting(meeting_id)
		{
//			URL="../meeting_detail.aspx?meeting_id=" + meeting_id;
//			myleft=(screen.availWidth-500)/2;
//			window.open(URL,"read_meeting","height=400,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");

			var mwidth = "600";
			var mheight = "450";
			var loc_x = parseInt((window.screen.width - mwidth) / 2);
			var loc_y = parseInt((window.screen.height - mwidth) / 2);

			var _oParameter = new Object();
			_oParameter.dialogTitle = "已申请会议";
			_oParameter.openFile ="../meeting_detail.aspx?meeting_id=" + meeting_id + "&num=" + Math.random();

			window.showModalDialog('shDialog.htm', _oParameter, 'dialogHeight:' + mheight + 'px;dialogWidth:' + mwidth + 'px;dialogLeft:' + loc_x + ';dialogTop:' + loc_y + ';help:no;status:no;scroll:yes;titlebar:no;toolbar:no');
   
        }
		
	function CheckForm()
	{
		if(!checkIsDate(document.Form1.txtStartTimeBegin.value) || !checkIsDate(document.Form1.txtStartTimeEnd.value))
		{
			alert("开始时间不正确！");		
			return (false);
		}		    
		return true;
	}
		</script>
	</HEAD>
	<body class="bodycolor" topMargin="5">
		<form id="Form1" method="post" runat="server">
         <div class="main_div">
			<TABLE class="small" cellSpacing="0" cellPadding="3" width="100%" border="0">
				<TR>
					<TD class="tab_ti"><SPAN class="big3">
							<asp:Literal id="litNavTitle" runat="server" Text="会议查询"></asp:Literal></SPAN>
					</TD>
				</TR>
			</TABLE>			
			<asp:panel id="pnlMain" runat="server">
				<TABLE width="500" cellSpacing="0" cellPadding="0" border="0" class="tab_pub" align="center">
					<TR>
						<TD class="ta_bg" noWrap>名称：</TD>
						<TD class="ta_txt"><INPUT class="BigInput" id="txtName" type="text" maxLength="50" size="20" name="txtName"
								runat="server"></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>主题：</TD>
						<TD class="ta_txt"><INPUT class="BigInput" id="txtTopic" type="text" maxLength="50" size="20" name="txtTopic"
								runat="server"></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>申请人：</TD>
						<TD class="ta_txt"><INPUT class="BigStatic fl" id="ToName" readOnly size="12" name="ToName" runat="server"></TEXTAREA>
						<INPUT class="bnt_Add fl" title="添加用户" onClick="user_single('ToId','ToName');" type="button" value="添加"
								name="button">
								<INPUT class="bnt_Del fl" title="清空用户" onClick="clear_double('ToId','ToName');" type="button" value="清空"
								name="button"><INPUT id="ToId" type="hidden" name="ToId" runat="server"></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>开始时间：</TD>
						<TD class="ta_txt"><INPUT class="BigInput" id="txtStartTimeBegin" type="text" maxLength="10" size="10" name="txtStartTimeBegin"
								runat="server"><IMG style="CURSOR: hand" onClick="popUpCalendar(this,txtStartTimeBegin,'yyyy-mm-dd','');"
								src="/module/date_selector/calendar.gif" align="absMiddle" border="0"> <INPUT class="BigInput" id="txtStartTimeEnd" type="text" maxLength="10" size="10" name="txtStartTimeEnd"
								runat="server"><IMG style="CURSOR: hand" onClick="popUpCalendar(this,txtStartTimeEnd,'yyyy-mm-dd','');"
								src="/module/date_selector/calendar.gif" align="absMiddle" border="0"></TD>
					</TR>					
					<TR>
						<TD class="ta_bg" noWrap>会议室：</TD>
						<TD class="ta_txt">
							<asp:DropDownList id="ddlRoomId" runat="server" CssClass="BigSelect"></asp:DropDownList></TD>
					</TR>
					<TR>
						<TD class="bnt_con" noWrap align="center" colSpan="2"><INPUT class="BigButton" title="进行查询" onClick="return CheckForm();" type="submit" value="查 询"
								name="button">
						</TD>
					</TR>
				</TABLE>
			</asp:panel>
			<asp:panel id="pnlQuery" runat="server" Visible="False">
			<br>			
				<asp:Repeater id="rptMeeting" runat="server" EnableViewState="False">
					<HeaderTemplate>
						<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0" class="tab_pub" align="center">
							<TR>
								<TD noWrap class="TableHeader" align="center">名称</TD>
								<TD noWrap class="TableHeader" align="center">主题</TD>
								<TD noWrap class="TableHeader" align="center">申请人</TD>
								<TD noWrap class="TableHeader" align="center">开始时间</TD>
								<TD noWrap class="TableHeader" align="center">会议室</TD>
								<TD noWrap class="TableHeader" align="center">状态</TD>
								<TD noWrap class="TableHeader" align="center">查看会议</TD>
							</TR>
					</HeaderTemplate>
					<ItemTemplate>
					<tr class="TableLine1">
						<td noWrap><%#Eval("Name")%></td>
						<td noWrap><%#Eval("Topic")%></td>
						<td noWrap align="center"><u title="部门：<%#Eval("DeptName")%>" style="cursor:hand"><%#Eval("ProposerName")%></u></td>
						<td noWrap align="center"><%#Eval("StartTime")%></td>
						<td noWrap align="center"><%#Eval("RoomName")%></td>
						<TD noWrap align="center">
						<%#Convert.ToInt32(Eval("Status")) == 0 ? "待批" : ""%>
						<%#(Convert.ToInt32(Eval("Status")) == 1) && (Convert.ToDateTime(Eval("StartTime")) < DateTime.Now) && (Convert.ToDateTime(Eval("EndTime")) > DateTime.Now) ? "进行中" : ""%>
						<%#(Convert.ToInt32(Eval("Status")) == 1) && (Convert.ToDateTime(Eval("StartTime")) > DateTime.Now) && (Convert.ToDateTime(Eval("EndTime")) > DateTime.Now) ? "已结束" : ""%>
						<%#(Convert.ToInt32(Eval("Status")) == 1) && ((Convert.ToDateTime(Eval("StartTime")) > DateTime.Now) || (Convert.ToDateTime(Eval("EndTime")) < DateTime.Now)) ? "已准" : ""%>
						<%#Convert.ToInt32(Eval("Status")) == 2 ? "未批准" : ""%>
						</TD>
						<td noWrap align="center">
							<a href="javascript:open_meeting('<%#Eval("MeetingId")%>');">会议信息</a>							
						</td>
					</tr>
					</ItemTemplate>
					<AlternatingItemTemplate>
					<tr class="TableLine2">
						<td><%#Eval("Name")%></td>
						<td><%#Eval("Topic")%></td>
						<td noWrap align="center"><u title="部门：<%#Eval("DeptName")%>" style="cursor:hand"><%#Eval("ProposerName")%></u></td>
						<td noWrap align="center"><%#Eval("StartTime")%></td>
						<td noWrap align="center"><%#Eval("RoomName")%></td>
						<TD noWrap align="center">
						<%#Convert.ToInt32(Eval("Status")) == 0 ? "待批" : ""%>
						<%#(Convert.ToInt32(Eval("Status")) == 1) && (Convert.ToDateTime(Eval("StartTime")) < DateTime.Now) && (Convert.ToDateTime(Eval("EndTime")) > DateTime.Now) ? "进行中" : ""%>
						<%#(Convert.ToInt32(Eval("Status")) == 1) && (Convert.ToDateTime(Eval("StartTime")) > DateTime.Now) && (Convert.ToDateTime(Eval("EndTime")) > DateTime.Now) ? "已结束" : ""%>
						<%#(Convert.ToInt32(Eval("Status")) == 1) && ((Convert.ToDateTime(Eval("StartTime")) > DateTime.Now) || (Convert.ToDateTime(Eval("EndTime")) < DateTime.Now)) ? "已准" : ""%>
						<%#Convert.ToInt32(Eval("Status")) == 2 ? "未批准" : ""%>
						</TD>
						<td noWrap align="center">
							<a href="javascript:open_meeting('<%#Eval("MeetingId")%>');">会议信息</a>							
						</td>
					</tr>
					</AlternatingItemTemplate>
					<FooterTemplate>
						</table>
					</FooterTemplate>
				</asp:Repeater>
				<asp:Literal id="litMessage" runat="server"></asp:Literal>
				<BR>
				<CENTER><INPUT class="BigButton" onClick="window.location='index.aspx';" type="button" value="返 回"></CENTER>
			</asp:panel>
            </div>
            </form>
	</body>
</HTML>
